class Solution {
public:
    bool CheckPermutation(string s1, string s2) {
        if(s1.size()!=s2.size()) return false;
        vector<int> array(128,0); 
        for(auto& cur:s1){
            array[cur]++;
        }
        for(auto& cur:s2){
            array[cur]--;
            if(array[cur]<0){
                return false;
            }
        }
        return true;
    }
};